<template>
    <div class="box">
        {{methodData}}
        <el-button type="primary" @click="btn2">传值</el-button>
        <el-button type="primary" @click="btn">不传值</el-button>
    </div>
</template>

<script>
export default {
    props: {
        methodData: {
            default: '',
            type: String,
        }
    },
    methods: {
        btn () {
            this.$emit('btn');
        },
        btn2 () {
            this.$emit('btn2', '这是传过去的值');
        }
    }
}
</script>

<style scoped>
.box {
    width: 100%;
    height: 100%;
    background: white;
    text-align: center;
    border: 1px solid black;
}
</style>